// slice模块片名
import {reqGetCateGoryby3Id} from '@/api/attr'
import tdRequest from '@/request/trademark'
import {createSlice} from "@reduxjs/toolkit"
import { useSelector } from "react-redux"

const categorySlice = createSlice({
    name:'category',
    initialState:{
        isShow:1
    },
    reducers:{
        UpIsShow(state,{payload}){
            state.isShow=payload
        }
    }
})

const {UpIsShow} =categorySlice.actions
export const useSelectorCateGoryList = ()=>useSelector((state:any)=>state.category)
export const changeIsShowNumber =(newShow:number)=>{
    return async(dispatch:any)=>{
        dispatch(UpIsShow(newShow))
    }
}
export default categorySlice.reducer